// pages/Search/Details/details.js
const app = getApp();
const teachers = app.globalData.searchResult;
Page({

  /**
   * 页面的初始数据
   */

  call: function (event) {

    wx.navigateTo({
      url: "calldetail/calldetail",
      success: function () {
        console.log("jump success")
      },
      fail: function () {
        console.log("jump fail") 
      },
      complete: function () {
        console.log("jump complete")
      }
    });
    
    

  },
  data: {
    teachers: {},
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  // console.log(teachers,'ccc');
  // console.log(app.globalData.searchResult,'dddd');
    var teachers= app.globalData.searchResult;
    const url = 'https://www.enjoyyz.com:8443/yinzuo/teaInfo';
    // app.globalData.userid = app.globalData.searchResult.userId;

    var teachers = app.globalData.searchResult;
    // console.log(app.globalData.searchResult, "app.globalData.searchResult");
    wx.request({
      url: url,
      data:{
        userId: app.globalData.searchResult.userId
      },
      success: res => {
        this.setData({
          teachers: teachers,
          teachers: app.globalData.searchResult,
        })
        app.globalData.teacherid = app.globalData.searchResult.userId
        console.log(app.globalData.searchResult, 'app.globalData.searchResult')
        console.log(res,'res11')
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})